<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2023/4/4
  Time: 11:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>student list page</title>
    <script>
        function del() {
            return confirm("del?");
        }
    </script>
</head>
<body>
<%@include file="add.jsp" %>
<hr>
<h1>student list page</h1>
<table border="1">
    <tr>
        <th>ID</th>
        <th>NAME</th>
        <th>GENDER</th>
        <th colspan="2">OPERATIONS</th>
    </tr>
    <c:forEach var="student" items="${sessionScope.pagination.list}">
        <tr>
            <td>${student.id}</td>
            <td>${student.name}</td>
            <td>${student.gender}</td>
            <td><a href="/student/queryById/${student.id}">edit</a></td>
            <td><a href="/student/removeById/${student.id}" onclick="return del()">remove</a></td>
        </tr>
    </c:forEach>
</table>
<c:import url="../page.jsp">
    <c:param name="path" value="student/${sessionScope.pagination.sqlId}"/>
</c:import>
</body>
</html>